Wat voor soort spel is dit?
Dit is een soort doolhof-horror spel waar de speler munten moeten pakken, en een monster ontwijken.
je moet in totaal 9 munten pakken om het spel te halen, een het monster word steeds sneller.
Waren er obstakels voor dit spel te maken?
Ja, ik had wel een paar obstakels. maar de obstakels hadden het meest te maken met Collision.
maar met de hulp van het internet had ik het na een lange tijd werkend te krijgen.
Hoe speel je het spel?
Je speelt het spel om met WASD te bewegen en door het doolhof te lopen.
Je moet het rode vierkant (monster) ontwijken en de gele vierkanten (munten) pakken.
Na de achtste munt moet je nog een groene munt pakken.
Hoe ziet de volledige code eruit?
deze code voor het speel is wel complex met meer dan 600 lines van code
Code
const Canvas = document.getElementById("Canvas")
const ctx = Canvas.getContext("2d")
const Character = Canvas.getContext("2d")
const coins = Canvas.getContext("2d")
const Monster = Canvas.getContext("2d")
const Walls = Canvas.getContext("2d")
const PlayerWalkSpeed = 3;
const PlayerColor = 000000;
const PlayerScaleXY = 20;
const MaxCoins = 8;
const minCoinDistance = 350;
const MaxWalls = 150;
var Breed = 0;
var Hoog = 0;
var Loading = true;
let x = 50;
let y = 50;
let vxl = 0;
let vxr = 0;
let vy = 0;
var player = Character.fillRect(0,0, 0, 0);
var CoinsRef = coins.fillRect(0,0, 0, 0);
var CoinCount = 0;
var coinlocationsX = [];
var coinlocationsY = [];
var CoinscaleXY = 10;
var CoinColor = "yellow";
CoinsBegin()
function UpdateScreen() {
ctx.clearRect(0,0, Canvas.width, Canvas.height)
Character.clearRect(0,0, Canvas.width, Canvas.height)
Character.beginPath();
Character.fillStyle = "white";
player = Character.fillRect(x,y, PlayerScaleXY, PlayerScaleXY)
Character.closePath();
Monster.beginPath();
Monster.fillStyle = "red";
Monster.fillRect(Spr2x, Spr2y, Spr2formaat, Spr2formaat);
Monster.closePath();
UpdatePlayerLocation();
DrawWalls();
Coins();
requestAnimationFrame(UpdateScreen)
}
setTimeout(UpdateScreen, 1000)
setTimeout(EindLoad, 7000) //7 seconden loaden
function UpdatePlayerLocation() {
if (checkWallCollision(x + vxl, y + vy, PlayerScaleXY)) {
vxl = 0;
}
if (checkWallCollision(x + vxr, y + vy, PlayerScaleXY )) {
vxr = 0;
}
if (checkWallCollision(x + vxl + vxr, y + vy, PlayerScaleXY)) {
vy = 0;
}
x += vxl;
x += vxr;
y += vy;
}
function CoinsBegin() {
for (let i = 0; i < MaxCoins; i++) {
coinlocationsX.push(Math.floor(Math.random() * 1400)) //De willekeurige locatie X van de munten maken
coinlocationsY.push(Math.floor(Math.random() * 800)) //De willekeurige locatie Y van de munten maken
}
}
function Coins() {
for (let i = 0; i < coinlocationsX.length; i++) {
coins.beginPath();
coins.fillStyle = CoinColor;
coins.fillRect(coinlocationsX.at(i),coinlocationsY.at(i), CoinscaleXY, CoinscaleXY);
coins.closePath();
for (let i = 0; i < coinlocationsX.length; i++) {
let coinX = coinlocationsX[i]; //de coinX variable maken
let coinY = coinlocationsY[i]; //de coinY variable maken
if (checkCoinWallCollision(coinX, coinY)) {
coinX = Math.random() * (Canvas.width - 20);
coinY = Math.random() * (Canvas.height - 20);
}
coinlocationsX[i] = coinX;
coinlocationsY[i] = coinY;
}
}
for (let i = 0; i < coinlocationsX.length; i++) {
let coinX = coinlocationsX[i];
let coinY = coinlocationsY[i];
if (checkCoinWallCollision(coinX, coinY)) {
coinX = Math.random() * (Canvas.width - 20);
coinY = Math.random() * (Canvas.height - 20);
}
for (let j = 0; j < coinlocationsX.length; j++) {
if (i !== j) {
let otherCoinX = coinlocationsX[j];
let otherCoinY = coinlocationsY[j];
let distance = Math.sqrt(Math.pow(coinX - otherCoinX, 2) + Math.pow(coinY - otherCoinY, 2));
if (distance < minCoinDistance) {
coinX = Math.random() * (Canvas.width - 20);
coinY = Math.random() * (Canvas.height - 20);
}
}
}
coinlocationsX[i] = coinX;
coinlocationsY[i] = coinY;
}
}
function CoinsCollisionCheck() {
for (let i = 0; i < coinlocationsX.length; i++) {
if(coinlocationsX.at(i) >= -10 || coinlocationsY.at(i) >= -10) {
if((coinlocationsX.at(i) + CoinscaleXY) < x ||
coinlocationsX.at(i) > (x + PlayerScaleXY) ||
(coinlocationsY.at(i) + CoinscaleXY) < y ||
coinlocationsY.at(i) > (y + PlayerScaleXY)) {
}
else {
if(!Loading) {
CoinCount = CoinCount + 1; //coin count 1 omhoog
console.log(CoinCount);
delete coinlocationsX[i];
delete coinlocationsY[i];
UpdateMonsterSpeed();
document.getElementById("CoinsCounter").textContent = "Coins: " + CoinCount;
if(CoinCount >= MaxCoins) {
EndCoin()
if (EndCoinReady) {
document.getElementById("CoinsCounter").textContent = "You Win";
document.getElementById("CoinsCounter").style.color = "green";
}
}
}
}
}
}
}
setInterval(CoinsCollisionCheck,3)
addEventListener('keydown', function (e){
if(e.code == 'KeyD') vxr = PlayerWalkSpeed;
if(e.code == 'KeyA') vxl = PlayerWalkSpeed * -1;
if(e.code == 'KeyS') vy = PlayerWalkSpeed;
if(e.code == 'KeyW') vy = PlayerWalkSpeed * -1;
})
addEventListener("keyup", function(e) {
if(e.code == 'KeyD') vxr = 0;
if(e.code == 'KeyA') vxl = 0;
if(e.code == 'KeyS') vy = 0;
if(e.code == 'KeyW') vy = 0;
})
function OuterWallCollision() {
var breed = Canvas.offsetWidth - PlayerScaleXY;
var hoog = Canvas.offsetHeight - PlayerScaleXY;
if(x <= 0){
x = 0;
}
if(y <= 0){
y = 0;
}
if(x >= breed)
{
x = breed;
}
if(y >= hoog)
{
y = hoog;
setTimeout(OuterWallCollision, 5)
}
OuterWallCollision()
function TrackPlayer() {
document.documentElement.style.setProperty('--cursorXpos', x + parseFloat(25) + "px")
document.documentElement.style.setProperty('--cursorYpos', y + parseFloat(75) + "px")
setTimeout(TrackPlayer, 50)
}
TrackPlayer()
function EindLoad() {
var modal = document.getElementById("modal");
modal.classList.remove("activemodal");
document.getElementById("Canvas").style.animation = "CanvasZoom 2s forward";
document.getElementById("Canvas2").style.animation = "CanvasZoom 2s forward";
document.documentElement.style.setProperty('--Radius',15 + "rem")
document.getElementById("CoinsCounter").textContent = "Coins: 0";
Loading = false;
}
document.documentElement.style.setProperty('--Radius', 3000 + "rem")
function LoadingText1() {
document.getElementById("LoadingText").innerHTML = "Loading.";
setTimeout(LoadingText2, 1500);
}
function LoadingText2() {
document.getElementById("LoadingText").innerHTML = "Loading..";
setTimeout(LoadingText3, 1000);
}
function LoadingText3() {
document.getElementById("LoadingText").innerHTML = "Loading...";
setTimeout(LoadingText1, 1000);
}
LoadingText1()
let Spr2x = 400;
let Spr2y = 220;
let MonsterSpeed = 0.5;
var Spr2formaat = 20;
var telSpr2 = 0;
var maxSpr2 = 100;
var richtSpr2X = 1;
var richtSpr2Y = 1;
var SeesPlayer = false;
function Spr2() {
if(SeesPlayer) {
if(x > Spr2x) {
richtSpr2X = MonsterSpeed;
}
if(x < Spr2x) {
richtSpr2X = MonsterSpeed * -1;
}
if(y > Spr2y) {
richtSpr2Y = MonsterSpeed;
}
if(y < Spr2y) {
richtSpr2Y = MonsterSpeed * -1;
}
}
else {
telSpr2++;
if (telSpr2 > maxSpr2) {
telSpr2 = 0;
richtSpr2X = Math.floor(Math.random()*3) -1;Spr2formaat
richtSpr2Y = Math.floor(Math.random()*3) -1;
}
}
if (checkWallCollision(Spr2x + richtSpr2X, Spr2y + richtSpr2Y, Spr2formaat)) {
richtSpr2X = 0;
}
if (checkWallCollision(Spr2x + richtSpr2X, Spr2y + richtSpr2Y, Spr2formaat)) {
richtSpr2Y = 0;
}
Spr2x += richtSpr2X;
Spr2y += richtSpr2Y;
if (Spr2x<0) {richtSpr2X = MonsterSpeed;}
if (Spr2x>Canvas.offsetWidth-Spr2formaat) {richtSpr2X = MonsterSpeed * -1;}
if (Spr2y<0) {richtSpr2Y = MonsterSpeed;}
if (Spr2y>Canvas.offsetHeight-Spr2formaat) {richtSpr2Y = MonsterSpeed * -1;}
}
setInterval(Spr2, 5)
function MonstercollisionCheck() {
if((x + PlayerScaleXY) < Spr2x ||
x > (Spr2x + Spr2formaat) ||
(y + PlayerScaleXY) < Spr2y ||
y > (Spr2y + Spr2formaat)) {
console.log("Not colliding");
}
else {
console.log("colliding")
}
}
setInterval(MonstercollisionCheck,5)
function UpdateMonsterSpeed() {
richtSpr2X = 0;
richtSpr2Y = 0;
MonsterSpeed = MonsterSpeed + (CoinCount * 0.05);
}
//Monster Eind
//Maze begin
const walls = [
{x: 100, y: 100, width: 50, height: 50},
{x: 300, y: 300, width: 50, height: 50},
{x: 400, y: 400, width: 50, height: 50}
];
walls.push(
{x: 100, y: 150, width: 50, height: 50},
{x: 150, y: 150, width: 50, height: 50},
{x: 200, y: 150, width: 50, height: 50},
{x: 300, y: 150, width: 50, height: 50},
{x: 350, y: 150, width: 50, height: 50},
{x: 200, y: 250, width: 50, height: 50},
{x: 200, y: 50, width: 50, height: 50},
{x: 150, y: 0, width: 50, height: 50},
{x: 100, y: 0, width: 50, height: 50},
{x: 200, y: 0, width: 50, height: 50},
{x: 150, y: 0, width: 50, height: 50},
{x: 100, y: 0, width: 50, height: 50},
{x: 50, y: 0, width: 50, height: 50},
{x: 0, y: 0, width: 50, height: 50},
{x: 0, y: 50, width: 50, height: 50},
{x: 0, y: 100, width: 50, height: 50},
{x: 0, y: 150, width: 50, height: 50},
{x: 0, y: 200, width: 50, height: 50},
{x: 0, y: 250, width: 50, height: 50},
{x: 0, y: 300, width: 50, height: 50},
{x: 0, y: 350, width: 50, height: 50},
{x: 50, y: 250, width: 50, height: 50},
{x: 50, y: 300, width: 50, height: 50},
{x: 100, y: 250, width: 50, height: 50},
{x: 200, y: 300, width: 50, height: 50},
{x: 200, y: 350, width: 50, height: 50},
{x: 150, y: 350, width: 50, height: 50},
{x: 150, y: 400, width: 50, height: 50},
{x: 100, y: 400, width: 50, height: 50},
{x: 50, y: 450, width: 50, height: 50},
{x: 100, y: 450, width: 50, height: 50},
{x: 50, y: 500, width: 50, height: 50},
{x: 50, y: 550, width: 50, height: 50},
{x: 50, y: 600, width: 50, height: 50},
{x: 50, y: 700, width: 50, height: 50},
{x: 100, y: 700, width: 50, height: 50},
{x: 100, y: 600, width: 50, height: 50},
{x: 100, y: 750, width: 50, height: 50},
{x: 150, y: 700, width: 50, height: 50},
{x: 200, y: 700, width: 50, height: 50},
{x: 250, y: 700, width: 50, height: 50},
{x: 250, y: 650, width: 50, height: 50},
{x: 250, y: 550, width: 50, height: 50},
{x: 200, y: 550, width: 50, height: 50},
{x: 100, y: 550, width: 50, height: 50},
{x: 100, y: 500, width: 50, height: 50},
{x: 200, y: 500, width: 50, height: 50},
{x: 250, y: 500, width: 50, height: 50},
{x: 300, y: 500, width: 50, height: 50},
{x: 350, y: 500, width: 50, height: 50},
{x: 450, y: 500, width: 50, height: 50},
{x: 550, y: 500, width: 50, height: 50},
{x: 350, y: 400, width: 50, height: 50},
{x: 300, y: 400, width: 50, height: 50},
{x: 200, y: 400, width: 50, height: 50},
{x: 300, y: 350, width: 50, height: 50},
{x: 300, y: 250, width: 50, height: 50},
{x: 350, y: 250, width: 50, height: 50},
{x: 400, y: 250, width: 50, height: 50},
{x: 450, y: 250, width: 50, height: 50},
{x: 450, y: 300, width: 50, height: 50},
{x: 300, y: 100, width: 50, height: 50},
{x: 300, y: 50, width: 50, height: 50},
{x: 350, y: 50, width: 50, height: 50},
{x: 400, y: 50, width: 50, height: 50},
{x: 500, y: 50, width: 50, height: 50},
{x: 500, y: 100, width: 50, height: 50},
{x: 500, y: 150, width: 50, height: 50},
{x: 450, y: 150, width: 50, height: 50},
{x: 400, y: 150, width: 50, height: 50},
{x: 600, y: 50, width: 50, height: 50},
{x: 600, y: 0, width: 50, height: 50},
{x: 600, y: 50, width: 50, height: 50},
{x: 550, y: 150, width: 50, height: 50},
{x: 600, y: 150, width: 50, height: 50},
{x: 650, y: 150, width: 50, height: 50},
{x: 700, y: 150, width: 50, height: 50},
{x: 700, y: 50, width: 50, height: 50},
{x: 750, y: 50, width: 50, height: 50},
{x: 800, y: 50, width: 50, height: 50},
{x: 850, y: 50, width: 50, height: 50},
{x: 800, y: 100, width: 50, height: 50},
{x: 800, y: 150, width: 50, height: 50},
{x: 800, y: 250, width: 50, height: 50},
{x: 800, y: 200, width: 50, height: 50},
{x: 500, y: 250, width: 50, height: 50},
{x: 550, y: 250, width: 50, height: 50},
{x: 650, y: 250, width: 50, height: 50},
{x: 650, y: 300, width: 50, height: 50},
{x: 650, y: 350, width: 50, height: 50},
{x: 600, y: 350, width: 50, height: 50},
{x: 550, y: 350, width: 50, height: 50},
{x: 550, y: 400, width: 50, height: 50},
{x: 500, y: 500, width: 50, height: 50},
{x: 500, y: 550, width: 50, height: 50},
{x: 500, y: 600, width: 50, height: 50},
{x: 450, y: 600, width: 50, height: 50},
{x: 400, y: 600, width: 50, height: 50},
{x: 400, y: 650, width: 50, height: 50},
{x: 400, y: 700, width: 50, height: 50},
{x: 400, y: 750, width: 50, height: 50},
{x: 350, y: 600, width: 50, height: 50},
{x: 350, y: 700, width: 50, height: 50},
{x: 450, y: 700, width: 50, height: 50},
{x: 450, y: 650, width: 50, height: 50},
{x: 500, y: 650, width: 50, height: 50},
{x: 500, y: 700, width: 50, height: 50},
{x: 600, y: 700, width: 50, height: 50},
{x: 650, y: 700, width: 50, height: 50},
{x: 700, y: 700, width: 50, height: 50},
{x: 600, y: 650, width: 50, height: 50},
{x: 600, y: 600, width: 50, height: 50},
{x: 650, y: 600, width: 50, height: 50},
{x: 650, y: 550, width: 50, height: 50},
{x: 650, y: 500, width: 50, height: 50},
{x: 650, y: 450, width: 50, height: 50},
{x: 650, y: 400, width: 50, height: 50},
{x: 700, y: 250, width: 50, height: 50},
{x: 800, y: 300, width: 50, height: 50},
{x: 800, y: 350, width: 50, height: 50},
{x: 750, y: 350, width: 50, height: 50},
{x: 750, y: 400, width: 50, height: 50},
{x: 750, y: 500, width: 50, height: 50},
{x: 750, y: 550, width: 50, height: 50},
{x: 750, y: 600, width: 50, height: 50},
{x: 800, y: 600, width: 50, height: 50},
{x: 800, y: 650, width: 50, height: 50},
{x: 800, y: 700, width: 50, height: 50},
{x: 800, y: 750, width: 50, height: 50},
{x: 850, y: 600, width: 50, height: 50},
{x: 900, y: 600, width: 50, height: 50},
{x: 950, y: 600, width: 50, height: 50},
{x: 1000, y: 600, width: 50, height: 50},
{x: 1000, y: 550, width: 50, height: 50},
{x: 1000, y: 500, width: 50, height: 50},
{x: 1000, y: 450, width: 50, height: 50},
{x: 1000, y: 400, width: 50, height: 50},
{x: 1000, y: 350, width: 50, height: 50},
{x: 950, y: 350, width: 50, height: 50},
{x: 900, y: 350, width: 50, height: 50},
{x: 900, y: 300, width: 50, height: 50},
{x: 900, y: 250, width: 50, height: 50},
{x: 900, y: 150, width: 50, height: 50},
{x: 950, y: 150, width: 50, height: 50},
{x: 950, y: 100, width: 50, height: 50},
{x: 950, y: 50, width: 50, height: 50},
{x: 950, y: 0, width: 50, height: 50},
{x: 950, y: 250, width: 50, height: 50},
{x: 1000, y: 250, width: 50, height: 50},
{x: 1100, y: 250, width: 50, height: 50},
{x: 1100, y: 300, width: 50, height: 50},
{x: 1100, y: 350, width: 50, height: 50},
{x: 1100, y: 400, width: 50, height: 50},
{x: 1100, y: 500, width: 50, height: 50},
{x: 1100, y: 550, width: 50, height: 50},
{x: 1100, y: 600, width: 50, height: 50},
{x: 1100, y: 650, width: 50, height: 50},
{x: 1100, y: 700, width: 50, height: 50},
{x: 1100, y: 800, width: 50, height: 50},
{x: 1150, y: 700, width: 50, height: 50},
{x: 1200, y: 700, width: 50, height: 50},
{x: 1250, y: 650, width: 50, height: 50},
{x: 1300, y: 650, width: 50, height: 50},
{x: 1400, y: 650, width: 50, height: 50},
{x: 1400, y: 600, width: 50, height: 50},
{x: 1400, y: 700, width: 50, height: 50},
{x: 1400, y: 750, width: 50, height: 50},
{x: 1350, y: 750, width: 50, height: 50},
{x: 1300, y: 750, width: 50, height: 50},
{x: 1200, y: 650, width: 50, height: 50},
{x: 1000, y: 700, width: 50, height: 50},
{x: 1000, y: 650, width: 50, height: 50},
{x: 900, y: 700, width: 50, height: 50},
{x: 900, y: 750, width: 50, height: 50},
{x: 1350, y: 550, width: 50, height: 50},
{x: 1400, y: 550, width: 50, height: 50},
{x: 1300, y: 550, width: 50, height: 50},
{x: 1200, y: 550, width: 50, height: 50},
{x: 1200, y: 500, width: 50, height: 50},
{x: 1200, y: 400, width: 50, height: 50},
{x: 1200, y: 350, width: 50, height: 50},
{x: 1200, y: 450, width: 50, height: 50},
{x: 1250, y: 350, width: 50, height: 50},
{x: 1250, y: 450, width: 50, height: 50},
{x: 1300, y: 450, width: 50, height: 50},
{x: 1350, y: 450, width: 50, height: 50},
{x: 1350, y: 350, width: 50, height: 50},
{x: 1400, y: 350, width: 50, height: 50},
{x: 1400, y: 300, width: 50, height: 50},
{x: 1400, y: 250, width: 50, height: 50},
{x: 1400, y: 200, width: 50, height: 50},
{x: 1350, y: 200, width: 50, height: 50},
{x: 1300, y: 200, width: 50, height: 50},
{x: 1250, y: 200, width: 50, height: 50},
{x: 1200, y: 200, width: 50, height: 50},
{x: 1150, y: 150, width: 50, height: 50},
{x: 1200, y: 150, width: 50, height: 50},
{x: 1050, y: 150, width: 50, height: 50},
{x: 1050, y: 100, width: 50, height: 50},
{x: 1050, y: 50, width: 50, height: 50},
{x: 1050, y: 0, width: 50, height: 50},
{x: 1150, y: 100, width: 50, height: 50},
{x: 1150, y: 0, width: 50, height: 50},
{x: 1350, y: 50, width: 50, height: 50},
{x: 1350, y: 100, width: 50, height: 50},
{x: 1300, y: 50, width: 50, height: 50},
{x: 1300, y: 100, width: 50, height: 50},
{x: 1250, y: 50, width: 50, height: 50},
{x: 0, y: 800, width: 5000, height: 50},
)
function wallsBegin() {
for (let i = 0; i < MaxWalls; i++) {
let RandomX = Math.floor(Math.random() * 1000);
let RandomY = Math.floor(Math.random() * 800);
RandomX = Math.round(RandomX / 50)*50;
RandomY = Math.round(RandomY / 50)*50;
walls.push({x:RandomX, y:RandomY,width:50, height:50});
}
}
function checkWallCollision(playerX, playerY, scale) {
for (let i = 0; i < walls.length; i++) {
let wall = walls[i];
if (playerX + scale > wall.x && playerX < wall.x + wall.width && playerY + scale > wall.y && playerY < wall.y + wall.height) {
return true;
}
}
return false;
}
function DrawWalls() {
for (let i = 0; i < walls.length; i++) {
let wall = walls[i];
ctx.beginPath();
ctx.fillStyle = "black";
ctx.fillRect(wall.x, wall.y, wall.width, wall.height);
ctx.closePath();
}
}
function checkCoinWallCollision(coinX, coinY) {
for (let i = 0; i < walls.length; i++) {
let wall = walls[i];
if (coinX + 20 > wall.x && coinX < wall.x + wall.width && coinY + 20 > wall.y && coinY < wall.y + wall.height) {
console.log("CoinColidw")
return true;
}
}
return false;
}
function doLinesIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {
let denominator = ((x2 - x1) * (y4 - y3)) - ((y2 - y1) * (x4 - x3));
let numerator1 = ((y1 - y3) * (x4 - x3)) - ((x1 - x3) * (y4 - y3));
let numerator2 = ((y1 - y3) * (x2 - x1)) - ((x1 - x3) * (y2 - y1));
if (denominator == 0) {
return numerator1 == 0 && numerator2 == 0;
}
let r = numerator1 / denominator;
let s = numerator2 / denominator;
return (r >= 0 && r <= 1) && (s >= 0 && s <= 1);
}
function checkPlayerAndWalls() {
let rayStartX = Spr2x + Spr2formaat/2;
let rayStartY = Spr2y + Spr2formaat/2;
let rayEndX = x + PlayerScaleXY/2;
let rayEndY = y + PlayerScaleXY/2;
for (let i = 0; i < walls.length; i++) {
let wall = walls[i];
if (doLinesIntersect(rayStartX, rayStartY, rayEndX, rayEndY, wall.x, wall.y, wall.x + wall.width, wall.y + wall.height)) {
SeesPlayer = false; //De SeesPlayer variable naar False veranderen
break;
} else {
SeesPlayer = true; //De SeesPlayer variable naar True veranderen
}
}
console.log("seesPlayer: ", SeesPlayer);
}
setInterval(checkPlayerAndWalls, 1000);
let EndCoinReady = false
function EndCoin() {
document.getElementById("CoinsCounter").textContent = "Escape";
document.getElementById("CoinsCounter").style.color = "red";
CoinColor = "green";
coinlocationsX.push(Math.floor(Math.random() * 1400))
coinlocationsY.push(Math.floor(Math.random() * 800))
setTimeout(EndCoinReadyToggle, 50)
}
function EndCoinReadyToggle() {
EndCoinReady = true
}